import Vue from 'vue'
import Router from 'vue-router'

import Home from '@/components/tabbar/home'
import Member from '@/components/tabbar/member'
import Shopcar from '@/components/tabbar/shopcar'
import Search from '@/components/tabbar/search'
import Newslist from '@/components/news/newslist'
import NewsInfo from '@/components/news/newsInfo'

Vue.use(Router);

export default new Router({
  linkActiveClass: 'mui-active', // 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/member',
      name: 'Member',
      component: Member
    },
    {
      path: '/shopcar',
      name: 'Shopcar',
      component: Shopcar
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/home/newslist',
      name: 'Newslist',
      component: Newslist
    },
    {
      path: '/home/newsInfo/:id',
      name: 'NewsInfo',
      component: NewsInfo
    }
  ]
})
